<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
    <!-- 生活委员 -->
    <title>财务管理</title>
    <meta name="viewport" content="width=device-width,initial-scale=1" />
    <meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">
	<link rel="stylesheet" type="text/css" href="css/f/navs.css">
	<link rel="stylesheet" type="text/css" href="css/f/default.css">
	<link rel="stylesheet" type="text/css" href="css/f/assignment.css"/>
	<script src="js/jquery.min.js"></script>
	<script src="js/f/default.js"></script>
	<script src="js/f/cadrelife.js"></script>
</head>

<body>
	<div class="all">
		<jsp:include page="/nav.jsp"></jsp:include>
        <div class="rightall float-left">
        	 	<div class="already">
	                <div class="already-title">
	        		<div class="left">添加明细</div>
	        		</div>
       			</div>
       			<div class="form-div" >
       				<input type="hidden" value="${error_msg }" name="errorMsg" />
	       			<form class="float-left" id="form-classfee">
	       				<input type="hidden" value="${pageNo }" name="pageNo">
		       			<div class="margin-top margin-left">
		       				<span style="margin-left:5%;"></span>
		       				收支：<select class="task form-input" name="state">
		       					<option value="-1">请选择</option>
		                        <option value="1">收入</option>
		                    	<option value="2">支出</option>
		                    </select>
		                	金额：<input class="task form-input" type="text" name="money">
		       				明细：<input  type="text" class="task form-input" name="content">
		       				<button class="task btn-style submit form-input form-submit" style="margin-right:0;">确认</button>
		       			</div>
	  				</form>
	  			</div>
  				<div class="already">
  					<c:if test="${not empty classfees}">
		                <div class="already-title">
		        			<div class="left">历史收支明细</div>
		        		</div>
	        		</c:if>
	        		<table>
		        		<c:forEach var="fee" items="${classfees }" varStatus="vs">
		        			<c:if test="${vs.count == 1 }">
			  					<tr class="tr-style-head">
				  					<td>班级</td>
				  					<td>办理人</td>
				  					<td>收支</td>
				  					<td>金额</td>
				  					<td>明细</td>
				  					<td>时间</td>
				  					<td>总金额</td>
			  					</tr>
							</c:if>	
	  					<tr class="tr-style">
	  						<td>${fee.className }</td>
		  					<td>${fee.userName}</td>
		  					<c:if test="${fee.classFeeState == 1}">
		  						<td style="color:blue;">收入</td>
		  					</c:if>
		  					<c:if test="${fee.classFeeState == 2}">
		  						<td style="color:red;">支出</td>
		  					</c:if>
		  					<td>${fee.money }</td>
		  					<td>${fee.details }</td>
		  					<td>${fee.createTime }</td>
		  					<td>${fee.total }</td>
		  				</tr>
	  				</c:forEach>
  				</table>
  				<c:if test="${pages > 1 }">
	            	<div class="previous">
	              	 		<c:if test="${pageNo > 1}"> <a href="cadre/classfee.do?pageNo=${pageNo-1 }">上一页</a> </c:if>
	              	 		<c:forEach var="p" begin="1" end="${pages }" step="1">
	              	 		<c:if test="${p==pageNo }">
	                   			<span style="font-size:18px;color:#446ee6;">&nbsp;${p}&nbsp;</span>
	                   		</c:if>
	                   		<c:if test="${p!=pageNo }">
	                   			<a href="cadre/classfee.do?pageNo=${p }" >&nbsp;${p}&nbsp;</a>
	                   		</c:if>
	               		 </c:forEach>
	                	<c:if test="${pageNo < pages}"><a href="cadre/classfee.do?pageNo=${pageNo+1 }">下一页</a></c:if>
	                </div>
               </c:if>
       		</div>
       	</div>		
 	</div>
  </body>
</html>
